<template>
    <LDrawerForm 
        :visible="visible"
        :confirmLoading="confirmLoading" 
        :title="title" 
        ref="cronLogForm" 
        :formAttributes="formAttributes" 
        @handleOk="handleOk" 
        @handleCancel="handleCancel"
        @handlerChange="handlerChange"></LDrawerForm>

</template>

<script>
import LDrawerForm from "@/components/lt/form/LDrawerForm"
import pick from 'lodash.pick'
import request from '@/utils/request'
import defaultSettings from '@/config/defaultSettings'

export default {
    name:'cronLogForm',
    components:{
        LDrawerForm
    },
    data(){
        return{
            title:'详情',
            visible:false,
            confirmLoading: false,
            
            model:{},
            formAttributes:{
              type:'',//collapse,tabs
              formItems:[
                {
                  title:'标签一',
                  columns:1,
                  fields:[
                    {field:'systemNo',label:'系统编号',disabled:true,component:'input',disabled:true},
                    {field:'taskName',label:'任务名称',component:'input',disabled:true},
                    {field:'beginTime',label:'开始时间',component:'input',disabled:true},
                    {field:'endTime',label:'结束时间',component:'input',disabled:true},
                    {field:'taskState',label:'执行结果',component:'input',disabled:true},
                    {field:'taskException',label:'异常信息',component:'textarea',rows:20,disabled:true},
                  ]
                },
              ]

            }


        }
    },
    methods:{
       
        edit (record) {
            
            this.visible = true;
            this.model = Object.assign({}, record);
            this.$nextTick(() => {
                this.$refs.cronLogForm.getForm().setFieldsValue(pick(this.model,'systemNo','taskName','beginTime','endTime','taskState','taskException'))
            })
        },
        handleOk(){
            this.close()
        },
        handleCancel(){
            this.visible=false
        },
        close () {
            this.$emit('close');
            this.visible = false;
        },
        /**
         * 表单内容发生变化
         */
        handlerChange(changeItem){
            console.log(changeItem)
           
        }
    },
    created(){
        
    },
}
</script>